home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BCI NET
/
BCI NET Dec 94.iso
/
archives
/
programming
/
source
/
vmem.lha
/
README
< prev
next >
Wrap
Text File
|
1991-12-19
|
4KB
|
84 lines
Hello there, and welcome to the (almost working ;-) world of VMem!
VMem attempts to add virtual memory to the standard Amiga OS. This version
requires a 68030 based Amiga. You can change the following #defines in
vmem.c to fine-tune vmem (at least until a debugged version parses the command
line):
DEF_SWAP_FILE_NAME = "work:.VMEM_PAGES"
DEF_NUMFRAMES = 0x80 /* 1M of frame space */
DEF_NUMPAGES = 0x200 /* 4M of pages */
Please note that the current version was developed and compiled under 1.3, but
preliminary tests indicate that it works (or doesn't work) under 2.x as well.
Use the memtest program to test VMem. Be very careful running programs that
write to disk while VMem is running, since it still crashes in nasty and
unexpected ways (you have been warned :-).
There are a few known design bugs which I am aware of:
1) DMA devices that write to virtual memory are hosed. One solution would be
to hook the dos.library vectors to Read() and Write(), and change those
functions so they work one page at a time. The hook could then force a page
into memory before DMA took place (just an idea). This would also fix the
problem with the paging device driver faulting---this event means the page
daemon can't replace faulted pages! For now, don't try running disk IO tasks
as VMem tests!
2) Access to the system free memory list is not arbitrated with a semaphore.
This could cause big problems, since a task could fault while AllocMem()ing,
another task could modify the mem list, then the faulted task could restart
and be holding on to a corrupt list (since Forbid() was broken!). Solution-
hook AllocMem()/FreeMem() and add a semaphore for the virtual memory pool.
That way only one task could fault at a time.
3) Anyone breaking the rules concerning the use of MEMF_PUBLIC where it needs
to be used is hosed. This is a good thing as far as I'm concerned.
Please use me as a clearing house for bug fixes to VMem. If you absolutely
HAVE to release your very own version (like if it runs only on very weird
hardware or something), please append your initials to the version number.
Tech Notes:
VMem works by setting up a page table with the '030's MMU, keeping track of
in-use frames with a background page ageing daemon, and handling the page
faults by putting the faulted task to sleep. Putting the faulted task to
sleep correctly was the tricky part, and had to be coded in assembly.
(The rest of VMem compiles with LC 5.1) The trick is pretty simple really:
when a task faults, record its stack frame and state into an allocated
buffer, fake in a harmless exception in a new stack (also part of the buffer),
signal the page daemon and go to sleep. The page daemon then fixes up the
fault, replaces the saved fault frame, restarts the faulted task and deallocates
the buffer.
Have fun!
- Ed
Internet: eah1@cec1.wustl.edu
USNail: Edward Hutchins,
#1W 6635 Washington Ave.,
St. Louis, MO 63130
Legal stuff:
VMem - a virtual memory system for the Amiga
Version 0.1 Copyright ©1990,91 Hutchins Software
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.